{{- $version := "0.1" }}
{{- $image_version := $version | replace "." "-" }}
---
image: {{ $.ModuleName }}/{{ $.ImageName }}-{{ $image_version }}
from: {{ $.Images.BASE_SCRATCH }}
import:
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact-{{ $image_version }}
  add: /
  to: /
  includePaths:
  - toml-merge
  - install
  - uninstall
  before: setup
docker:
  LABEL:
    distro: all
    version: all
    jq: {{ $version }}
---
artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact-{{ $image_version }}
from: {{ $.Images.BASE_GOLANG_19_ALPINE }}
git:
  - add: /{{ $.ModulePath }}modules/007-{{ $.ModuleName }}/images/{{ $.ImageName }}/scripts
    to: /
    stageDependencies:
      setup:
      - '**/*'
  - add: /{{ $.ModulePath }}modules/007-{{ $.ModuleName }}/images/{{ $.ImageName }}/src
    to: /src
    stageDependencies:
      setup:
        - '**/*'
shell:
  setup:
  - cd src && GOPROXY={{ .GOPROXY }} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /toml-merge toml-merge.go
